import request from '@/utils/request'

// 分页查询仓库
export const getWarehouseData = (data) => request.get('/warehouse/page', {
  params: {
    descs: 'createTime',
    ...data
  }
})

// 删除仓库
export const delWarehouseData = (data) => request.delete('/warehouse', {
  params: data
})

// 修改仓库
export const updateWarehouseData = (data) => request.put('/warehouse', data)

// 新增仓库
export const addWarehouse = (data) => request.post('/warehouse', data)

// 查询仓库
export const queryWarehouse = (id) => request.get(`/warehouse/${id}`)

// 获取下一个编码
export const nextCodeFactory = (data) => request.get(`/codeFactory/next/${data.name}`)

// 查询全部仓库
export const queryAllWarehouse = (data) => request.get('/warehouse/list', {
  params: data
})

// 查询全部库位详细信息
export const queryAllposition = (data) => request.get('/location/listDetail', {
  params: data
})
